﻿using System.Reflection;

namespace GenUI.WPF.GenControls
{
    internal static class PropGridExtend
    {
        /// <summary>
        /// 通过反射获取特性Name
        /// </summary>
        /// <param name="member"></param>
        /// <returns></returns>
        internal static string GetPropGridMapName(this MemberInfo member)
            => member.IsDefined(typeof(PropGridMapAttribute), false) ?
               member.GetCustomAttribute<PropGridMapAttribute>().MapName : member.Name;
    }
}
